package com.shiminghui;

public class ErWeiShuZu {
    public static void main(String[] args) {
        int[][] arr = {{1,2,3},{4,5,6}};
        for (int i = 0; i < arr.length; i++) {
            for (int i1 = 0; i1 < arr[i].length; i1++) {
                System.out.print(arr[i][i1]+" ");
            }
            System.out.println();
        }

        int yearNum=0;
        for (int i = 0; i < arr.length; i++) {
            int sum = getSum(arr[i]);
            yearNum +=sum;
        }
        System.out.println(yearNum);
    }
    private static int getSum(int[] arr){
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        return sum;
    }

}
